{% from 'macros.html' import block_field, inline_field %} {% set filtering = form_type
== "group_filtering" %}
<form
  id="{{ form_type }}-form"
  class="form-horizontal form-label-left add-id"
  method="post"
  autocomplete="off"
>
  {{ form.id(id='group-id', class="add-id") }} {{ form.hidden_tag() }}
  <div class="modal-body">
    <ul class="nav nav-tabs bar_tabs">
      <li class="nav-item active">
        <a class="nav-link" data-toggle="tab" href="#group-properties"
          >Main Properties</a
        >
      </li>
      {% if not filtering %}
      <li class="nav-item">
        <a class="nav-link" data-toggle="tab" href="#group-ui-access"
          >Menu and Endpoint Access</a
        >
      </li>
      <li class="nav-item">
        <a class="nav-link" data-toggle="tab" href="#group-model-access"
          >Default Model Access</a
        >
      </li>
      {% endif %}
      <li class="nav-item">
        <a class="nav-link" data-toggle="tab" href="#group-pool-access"
          >Device RBAC Setup</a
        >
      </li>
    </ul>
    <div class="form-group">
      <div class="tab-content">
        <div class="tab-pane fade in active" id="group-properties">
          <div id="content" class="add-id" style="height: 100%;"></div>
          {% for field in form if field.name in ("name", "creator", "admin_only",
          "force_read_access", "description", "email", "users") or field.name in
          form.custom_properties %} {{ block_field(form, field.name) }} {% endfor %}
        </div>
        {% if not filtering %}
        <div class="tab-pane fade" id="group-ui-access">
          {% for field in form %} {% if field.name in ("menu", "pages", "get_requests",
          "post_requests", "delete_requests") %} {{ inline_field(form_type, field) }} {%
          endif %} {% endfor %}
        </div>
        <div class="tab-pane fade" id="group-model-access">
          {% for field in form %} {% if field.name.split("_")[0] in rbac["rbac_models"]
          %} {{ inline_field(form_type, field) }} {% endif %} {% endfor %}
        </div>
        {% endif %}
        <div class="tab-pane fade" id="group-pool-access">
          {% for field in form %} {% if field.name in form.pool_properties %} {{
          inline_field(form_type, field) }} {% endif %} {% endfor %}
        </div>
      </div>
    </div>
  </div>
</form>
